<% if @order.could_use_store_credit? %>
  <ul class="list-group mb-3">
    <%= f.fields_for :source, @payment.source do |source_form| %>
      <% @store_credits.each do |credit| %>
        <li class="list-group-item p-0">
          <%= source_form.label :id, value: credit.id, class: "form-check-label d-flex align-items-center gap-3 px-3 py-3 w-100 cursor-pointer hover-light" do %>
            <div class="form-check flex align-items-center">
              <%= source_form.radio_button :id, credit.id, class: "form-check-input", checked: @payment.source.id == credit.id || @store_credits.first.id == credit.id %>
            </div>
            <div class="font-weight-normal">
              <%= Spree.t('admin.store_credit.amount_remaining_of_total', amount: credit.display_amount_remaining, total: credit.display_amount).html_safe %>
            </div>
          <% end %>
        </li>
      <% end %>
    <% end %>
  </ul>
<% else %>
  <div class="alert alert-danger w-100">
    <%= Spree.t('admin.user.no_store_credit') %>
  </div>
<% end %>
